package com.atguigu.cloud.sevice;

import com.atguigu.cloud.entities.Product;
import com.atguigu.cloud.tool.load.page.PaginationResult;

import java.util.List;

/**
 * @Auter zzh
 * @Date 2024/11/13
 */
public interface ProductService {
    Product getById(Integer id);
    List<Product> getAll();
    int add(Product product);
    int delete(Integer id);
    int update(Product product);

    //按照价格区间搜索商品
    List<Product> getByPrice(Integer min, Integer max);

    //模糊查询
    List<Product> getByLike(String name);

    //按照类别搜索商品
    List<Product> getByDistribution(String category);

    //分页
    PaginationResult<Product> getPaginationAll(Integer currentPage);
    PaginationResult<Product> getPaginationByPrice(Integer min,Integer max,Integer currentPage);
    PaginationResult<Product> getPaginationByLike(String proname,Integer currentPage);
    PaginationResult<Product> getPaginationByDistribution(String category,Integer currentPage);

}
